#ifndef __OJDATA_H__
#define __OJDATA_H__
#include <unordered_map>
#include <map>
#include <vector>
#include <memory>
#include <fstream>
#include <functional>
#include "jsonObject.h"
#include "options.h"


extern std::unordered_map<int, std::string> codeToStr; // 用于查看对应的错误码的字符串显示

class ProcessStatus
{
public:
    int result = WAIT_JUDGE;
    int time = 0;
    int memory = 0;
    long long errorcode = 0; // 用来存储进程退出码,0并表示正常退出,-1表示未知意外,1-255则是linux规定的以及options.h中定义的退出码
    std::string output = "";
    std::string error = "";
    // 扩展字段,用于存储一些额外信息
    JsonObjectPtr extern_info = JSONOBJECT(nullptr);
    friend std::ostream &operator<<(std::ostream &out, const ProcessStatus &ps);
    std::string json() const;
};

#endif /* __OJDATA_H__ */
